/**
 */
package mobilex.impl;

import mobilex.Image;
import mobilex.MobilexPackage;

import org.eclipse.emf.common.notify.Notification;

import org.eclipse.emf.ecore.EClass;

import org.eclipse.emf.ecore.impl.ENotificationImpl;

/**
 * <!-- begin-user-doc -->
 * An implementation of the model object '<em><b>Image</b></em>'.
 * <!-- end-user-doc -->
 * <p>
 * The following features are implemented:
 * <ul>
 *   <li>{@link mobilex.impl.ImageImpl#getPath <em>Path</em>}</li>
 *   <li>{@link mobilex.impl.ImageImpl#getVerticalPosition <em>Vertical Position</em>}</li>
 *   <li>{@link mobilex.impl.ImageImpl#getHorizontalPosition <em>Horizontal Position</em>}</li>
 * </ul>
 * </p>
 *
 * @generated
 */
public class ImageImpl extends ComponentImpl implements Image {
	/**
	 * The default value of the '{@link #getPath() <em>Path</em>}' attribute.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getPath()
	 * @generated
	 * @ordered
	 */
	protected static final String PATH_EDEFAULT = null;

	/**
	 * The cached value of the '{@link #getPath() <em>Path</em>}' attribute.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getPath()
	 * @generated
	 * @ordered
	 */
	protected String path = PATH_EDEFAULT;

	/**
	 * The default value of the '{@link #getVerticalPosition() <em>Vertical Position</em>}' attribute.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getVerticalPosition()
	 * @generated
	 * @ordered
	 */
	protected static final Integer VERTICAL_POSITION_EDEFAULT = null;

	/**
	 * The cached value of the '{@link #getVerticalPosition() <em>Vertical Position</em>}' attribute.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getVerticalPosition()
	 * @generated
	 * @ordered
	 */
	protected Integer verticalPosition = VERTICAL_POSITION_EDEFAULT;

	/**
	 * The default value of the '{@link #getHorizontalPosition() <em>Horizontal Position</em>}' attribute.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getHorizontalPosition()
	 * @generated
	 * @ordered
	 */
	protected static final Integer HORIZONTAL_POSITION_EDEFAULT = null;

	/**
	 * The cached value of the '{@link #getHorizontalPosition() <em>Horizontal Position</em>}' attribute.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getHorizontalPosition()
	 * @generated
	 * @ordered
	 */
	protected Integer horizontalPosition = HORIZONTAL_POSITION_EDEFAULT;

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	protected ImageImpl() {
		super();
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	protected EClass eStaticClass() {
		return MobilexPackage.Literals.IMAGE;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public String getPath() {
		return path;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public void setPath(String newPath) {
		String oldPath = path;
		path = newPath;
		if (eNotificationRequired())
			eNotify(new ENotificationImpl(this, Notification.SET, MobilexPackage.IMAGE__PATH, oldPath, path));
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public Integer getVerticalPosition() {
		return verticalPosition;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public void setVerticalPosition(Integer newVerticalPosition) {
		Integer oldVerticalPosition = verticalPosition;
		verticalPosition = newVerticalPosition;
		if (eNotificationRequired())
			eNotify(new ENotificationImpl(this, Notification.SET, MobilexPackage.IMAGE__VERTICAL_POSITION, oldVerticalPosition, verticalPosition));
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public Integer getHorizontalPosition() {
		return horizontalPosition;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public void setHorizontalPosition(Integer newHorizontalPosition) {
		Integer oldHorizontalPosition = horizontalPosition;
		horizontalPosition = newHorizontalPosition;
		if (eNotificationRequired())
			eNotify(new ENotificationImpl(this, Notification.SET, MobilexPackage.IMAGE__HORIZONTAL_POSITION, oldHorizontalPosition, horizontalPosition));
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public Object eGet(int featureID, boolean resolve, boolean coreType) {
		switch (featureID) {
			case MobilexPackage.IMAGE__PATH:
				return getPath();
			case MobilexPackage.IMAGE__VERTICAL_POSITION:
				return getVerticalPosition();
			case MobilexPackage.IMAGE__HORIZONTAL_POSITION:
				return getHorizontalPosition();
		}
		return super.eGet(featureID, resolve, coreType);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public void eSet(int featureID, Object newValue) {
		switch (featureID) {
			case MobilexPackage.IMAGE__PATH:
				setPath((String)newValue);
				return;
			case MobilexPackage.IMAGE__VERTICAL_POSITION:
				setVerticalPosition((Integer)newValue);
				return;
			case MobilexPackage.IMAGE__HORIZONTAL_POSITION:
				setHorizontalPosition((Integer)newValue);
				return;
		}
		super.eSet(featureID, newValue);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public void eUnset(int featureID) {
		switch (featureID) {
			case MobilexPackage.IMAGE__PATH:
				setPath(PATH_EDEFAULT);
				return;
			case MobilexPackage.IMAGE__VERTICAL_POSITION:
				setVerticalPosition(VERTICAL_POSITION_EDEFAULT);
				return;
			case MobilexPackage.IMAGE__HORIZONTAL_POSITION:
				setHorizontalPosition(HORIZONTAL_POSITION_EDEFAULT);
				return;
		}
		super.eUnset(featureID);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public boolean eIsSet(int featureID) {
		switch (featureID) {
			case MobilexPackage.IMAGE__PATH:
				return PATH_EDEFAULT == null ? path != null : !PATH_EDEFAULT.equals(path);
			case MobilexPackage.IMAGE__VERTICAL_POSITION:
				return VERTICAL_POSITION_EDEFAULT == null ? verticalPosition != null : !VERTICAL_POSITION_EDEFAULT.equals(verticalPosition);
			case MobilexPackage.IMAGE__HORIZONTAL_POSITION:
				return HORIZONTAL_POSITION_EDEFAULT == null ? horizontalPosition != null : !HORIZONTAL_POSITION_EDEFAULT.equals(horizontalPosition);
		}
		return super.eIsSet(featureID);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public String toString() {
		if (eIsProxy()) return super.toString();

		StringBuffer result = new StringBuffer(super.toString());
		result.append(" (path: ");
		result.append(path);
		result.append(", verticalPosition: ");
		result.append(verticalPosition);
		result.append(", horizontalPosition: ");
		result.append(horizontalPosition);
		result.append(')');
		return result.toString();
	}

} //ImageImpl
